﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace ShanNiang.Service.Constants
{
    public class CommonData
    {

        #region 常量
        /// <summary>
        /// 当前应用的互斥名称
        /// </summary>
        public const string ApplicationMutexName = "Global\\ShanNiang_Packing";
        /// <summary>
        /// 绑定成功
        /// </summary>
        public const string BindSuccess = "BindSuccess";
        /// <summary>
        /// 分享内存名称
        /// </summary>
        public const string SharedMemoryName = "XkmWork";
        /// <summary>
        /// 缓存的数据文件
        /// </summary>
        public const string DataFolder = "SnSoft/XkmWork/CacheDatas";
        /// <summary>
        /// 默认分页大小
        /// </summary>
        public const int DEFAULT_PAGE_SIZE = 10;
        /// <summary>
        /// 获取令牌
        /// </summary>
        public const string GotToken = "GotToken";
        /// <summary>
        /// 刷新箱码
        /// </summary>
        public const string RefreshBoxCodes = "RefreshBoxCodes";
        /// <summary>
        /// 查询箱码
        /// </summary>
        public const string QueryBox = "QueryBox";
        /// <summary>
        /// 切换到装箱页
        /// </summary>
        public const string ToPackingBox = "ToPackingBox";
        /// <summary>
        /// 菜单图标
        /// </summary>
        public const char MENU_ICON_DEFAULT = '\ue608';
        public const char MENU_ICON_BOXHISTORY = '\ue607';
        public const char MENU_ICON_LOGIN = '\ue609';
        public const char MENU_ICON_LOGOUT = '\ue609';
        public const char MENU_ICON_PACKBOX = '\ue608';
        public const char MENU_ICON_PACKPALLET = '\ue60c';
        public const char MENU_ICOM_PALLETHISTORY = '\ue60d';  
        public const char MENU_ICON_UNPACKING = '\ue607';
        /// <summary>
        /// 菜单编码  装箱记录
        /// </summary>
        public const string MENU_BOXHISTORY = "packingHistory";
        /// <summary>
        /// 菜单编码  登录
        /// </summary>
        public const string MENU_LOGIN = "Login";
        /// <summary>
        /// 菜单编码  退出登录
        /// </summary>
        public const string MENU_LOGOUT = "Logout";
        /// <summary>
        /// 菜单编码 装箱
        /// </summary>
        public const string MENU_PACKBOX = "encasement";
        /// <summary>
        /// 菜单编码  装托
        /// </summary>
        public const string MENU_PACKPALLET = "pakingToPallet";
        /// <summary>
        /// 菜单编码  装托记录
        /// </summary>
        public const string MENU_PALLETHISTORY = "palletHistory";
        /// <summary>
        /// 菜单编码 拆拖
        /// </summary>
        public const string MENU_UNPACKING = "Unpacking";
        /// <summary>
        /// 原始 认证服务器
        /// </summary>
        public const string OriginalIdentityServer = "https://ids.shan-niang.com";
        /// <summary>
        /// 重定向到微信 api地址
        /// </summary>
        public const string RedirectToWeChat = "/api/AppGrant/RedirectToWeChatLogin";
        /// <summary>
        /// WebView2  临时文件保存路径
        /// </summary>
        public const string WebView2DataFolder = "SnSoft/XkmWork/WebView2Temp";
        /// <summary>
        /// 微信 回调地址
        /// </summary>
        public const string WeChatCallback = "/App/Logging";
        /// <summary>
        /// 雪克码的  权限作用域
        /// </summary>
        public const string XkmScopes = "scope_jdl_miniprogram openid profile";
        #endregion




        #region 只读变量
        /// <summary>
        /// 商品条码正则
        /// </summary>
        public readonly static Regex Regex_Barcode = new("^\\d{12,13}$", RegexOptions.Compiled);
        /// <summary>
        /// 瓶码正则
        /// </summary>
        public readonly static Regex Regex_BottleCode = new("(?<=https?://(t.)?xk0.cc/_)(\\w|-){11}", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        /// <summary>
        /// 箱码正则
        /// </summary>
        public readonly static Regex Regex_BoxCode = new("(?<=Box://)(\\w|-){11}", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        /// <summary>
        /// 表示Int64的urlbase64字符串正则
        /// </summary>
        public readonly static Regex Regex_Int64Code = new("^(\\w|-){11}$", RegexOptions.Compiled);
        /// <summary>
        /// 托码正则
        /// </summary>
        public readonly static Regex Regex_PalletCode = new("(?<=Pallet://)(\\w|-){11}", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        /// <summary>
        /// 手机号正则
        /// </summary>
        public static readonly Regex Regex_PhoneNumber = new Regex("^1[3-9]{1}[0-9]{9}$", RegexOptions.Compiled);
        /// <summary>
        /// 验证码正则
        /// </summary>
        public static readonly Regex Regex_SmsCode = new Regex("^\\d{6}$", RegexOptions.Compiled);
        #endregion

    }
}
